POV-Ray : Newsgroups : povray.programming : void pointer array problem : void pointer array problem Server Time
28 Jul 2024 08:19:02 EDT (-0400)
  void pointer array problem  
From: cadman
Date: 1 Jul 2002 17:35:03
Message: <3d20cb07$1@news.povray.org>
This is probably more a general C++ question, but I'm working on a POV
project, so I know you'll be glad to help.  How do I assign some typed
pointer X to an element of a void pointer array?  Here's what I have
(greatly simplified):

void **array;
array=(void **) malloc(sizeof(void *)*NumberOfElements);

CMyObject *thing;
thing=new CMyObject();

location=&array[4];
//compiler chokes here (invalid indirection):
*location=thing;

Thanks in advance for your invaluable help.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.